/*
*  Copyright 2019-2025 Zheng Jie
*
*  Licensed under the Apache License, Version 2.0 (the "License");
*  you may not use this file except in compliance with the License.
*  You may obtain a copy of the License at
*
*  http://www.apache.org/licenses/LICENSE-2.0
*
*  Unless required by applicable law or agreed to in writing, software
*  distributed under the License is distributed on an "AS IS" BASIS,
*  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*  See the License for the specific language governing permissions and
*  limitations under the License.
*/
package com.hua.api.modules.finance.domain;

import lombok.Data;
import cn.hutool.core.bean.BeanUtil;
import io.swagger.annotations.ApiModelProperty;
import cn.hutool.core.bean.copier.CopyOptions;
import javax.persistence.*;
import javax.validation.constraints.*;
import java.sql.Timestamp;
import java.math.BigDecimal;
import java.io.Serializable;
import java.util.Date;

/**
* @website https://eladmin.vip
* @description /
* @author bill
* @date 2025-07-17
**/
@Entity
@Data
@Table(name="order_bill")
public class OrderBill implements Serializable {

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(name = "`id`")
    @ApiModelProperty(value = "id")
    private Integer id;

    @Column(name = "`order_no`")
    @ApiModelProperty(value = "订单号")
    private String orderNo;

    @Column(name = "`user_id`")
    @ApiModelProperty(value = "商家用户")
    private Integer userId;

    @Column(name = "`shop_id`")
    @ApiModelProperty(value = "商家店铺")
    private Integer shopId;

    @Column(name = "`created_time`")
    @ApiModelProperty(value = "结算日期")
    private Date createdTime;

    @Column(name = "`total_money_yuan`")
    @ApiModelProperty(value = "订单实际支付金额")
    private Double totalMoneyYuan;

    @Column(name = "`real_money_yuan`")
    @ApiModelProperty(value = "商家实际收入金额")
    private Double realMoneyYuan;

    @Column(name = "`profit_money_yuan`")
    @ApiModelProperty(value = "利润值")
    private Double profitMoneyYuan;

    @Column(name = "`bill_desc`")
    @ApiModelProperty(value = "备注")
    private String billDesc;

    @Column(name = "`state`")
    @ApiModelProperty(value = "状态 0:未入账 1：已入账 ")
    private Integer state;

    public void copy(OrderBill source){
        BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true));
    }
}
